x86/xsave: adjust state management
authorJan Beulich <jbeulich@suse.com>
Tue, 2 Jul 2013 06:41:28 +0000 (08:41 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 2 Jul 2013 06:41:28 +0000 (08:41 +0200)
commitf9755488bf17c056111d1e442be394cfb63d7788
tree224e860b016512cac04f1d67503ad30ea1f391a2
parent7b62e6bd2fcc862360c741cf64d2cbce7825402b
x86/xsave: adjust state management

The initial state for a vCPU is using default values, so there's no
need to force the XRSTOR to read the state from memory. This saves a
couple of thousand restores from memory just during boot of Linux on
my Sandy Bridge system (I didn't try to make further measurements).

The above requires that arch_set_info_guest() updates the state flags
in the save area when valid floating point state got passed in, but
that would really have been needed even before in case XSAVE{,OPT}
decided to clear one or both of the FP and SSE bits.

Furthermore, hvm_vcpu_reset_state() shouldn't just clear out the FPU/
SSE area, but needs to re-initialized MXCSR and FCW.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/domain.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/xstate.c
xen/include/asm-x86/xstate.h